<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            perspective: 400px;
        }
        .box {
            width: 300px;
            height: 300px;
            margin: 100px auto;
            position: relative;
            transition: all 1s;
            /* 让蓝色盒子保留立体空间--给父 */
            transform-style: preserve-3d;
        }

        .front,
        .back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            text-align: center;
            line-height: 300px;
            color: aliceblue;
            font-size: 30px;
        }

        /* 直接将盒子反转就会发现字反过来了？
        将盒子背靠背 1.将一个盒子反转，然后紧贴
         */
        .front {
            z-index: 1;
            transform: rotateY(180deg);
            background-color: pink;
        }

        .back {
            transform: rotateY(360deg) translateZ(-10px);
            /* 背靠背 */
            /* z-index: 2; */
            background-color: rebeccapurple;
        }

        .box:hover {
            transform: rotateY(360deg);
        }
    </style>
</head>

<body>
    <!-- 直接旋转box 不反转面 -->
    <div class="box">
        <div class="front">啦啦啦</div>
        <div class="back">哈哈哈</div>
    </div>
</body>

</html>